// 导入axios实例
import { get, post, put, del } from '../utils/request';

// 部门相关API服务
export const departmentService = {
  // 获取部门列表
  getDepartments: (params) => {
    return get('/api/departments', params);
  },
  
  // 获取单个部门详情
  getDepartmentById: (id) => {
    return get(`/api/departments/${id}`);
  },
  
  // 创建新部门
  createDepartment: (departmentData) => {
    return post('/api/departments', departmentData);
  },
  
  // 更新部门信息
  updateDepartment: (id, departmentData) => {
    return put(`/api/departments/${id}`, departmentData);
  },
  
  // 删除部门
  deleteDepartment: (id) => {
    return del(`/api/departments/${id}`);
  }
};

export default departmentService;